import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpCourseTerm {
  id!: number;
  courseId?: number;
  termTime?: string;
  userId?: number;
  uniacid?: number;
  courseType?: number;
  buyType: number = 1;
}

export const ImsYzdKpCourseTermSchema = new EntitySchema({
  class: ImsYzdKpCourseTerm,
  properties: {
    id: { primary: true, type: 'number' },
    courseId: { type: 'number', nullable: true, index: 'course_id' },
    termTime: { type: 'string', length: 255, nullable: true },
    userId: { type: 'number', nullable: true, index: 'user_id' },
    uniacid: { type: 'number', nullable: true, index: 'uniacid' },
    courseType: { type: 'number', nullable: true, index: 'course_type' },
    buyType: { type: 'number', default: 1 },
  },
});
